#!/bin/sh
 
cd ./

case "$1" in
start)
    ./main.py -worker=100 -logging=error -log_file_prefix=./Logs/test.log &
;;
stop)
    ps aux | grep "python ./main.py" | awk '{print $2}' | xargs kill -9
;;
restart)
    echo 'exec stop then start'
    ps aux | grep "python ./main.py" | awk '{print $2}' | xargs kill -9
    ./main.py -worker=100 -logging=error -log_file_prefix=./Logs/test.log &
;;
*)
    echo 'Usage: start stop restart'
esac
